﻿/*
版权所有：版权所有(C) 2011，刘建新
文件编号：M01_ProductsType.cs
文件名称：ProductsType.cs
系统编号：Z0003007
系统名称：通用办公系统
模块编号：M01
模块名称：信息发布
设计文档：IOA_M01信息发布XDE建模.mdx
完成日期：2011-01-22
作　　者：
内容摘要：表[Products_Type]对应的实体类
*/

using System;
using System.Collections;
using System.Data;


namespace Eis51.CampanyCMS.Model.Bus
{
		/// <summary>
		/// 类 编 号：
		/// 类 名 称：ProductsType
		/// 内容摘要：
		/// </summary>
		
		[Serializable]
		public class ProductsType : BaseModel
		{
		#region 自动生成代码
		
			#region 重载Equals/GetHashCode
			/// <summary>
			/// 重载Equals			
			/// </summary>
			public override bool Equals (Object obj)
			{
				if (obj != null && obj is ProductsType)
				{
					if (obj == this)
						return true;
					ProductsType castObj = (ProductsType)obj; 
					
					if (!this.m_Seqno.Equals(castObj.Seqno))
						return false;
						
					if (!this.m_Title.Equals(castObj.Title))
						return false;
						
					if (!this.m_Parentid.Equals(castObj.Parentid))
						return false;
						
					if (!this.m_Level.Equals(castObj.Level))
						return false;
						
					if (!this.m_Showdescr.Equals(castObj.Showdescr))
						return false;
						
					if (!this.m_Code.Equals(castObj.Code))
						return false;
						
					if (!this.m_Keyword.Equals(castObj.Keyword))
						return false;
						
					if (!this.m_Content.Equals(castObj.Content))
						return false;
						
					if (!this.m_Filename.Equals(castObj.Filename))
						return false;
						
					if (!this.m_Licd.Equals(castObj.Licd))
						return false;
						
					if (!this.m_Createdate.Equals(castObj.Createdate))
						return false;
						
					if (!this.m_Createby.Equals(castObj.Createby))
						return false;
						
					if (!this.m_Lastupdatedate.Equals(castObj.Lastupdatedate))
						return false;
						
					if (!this.m_Lastupdateby.Equals(castObj.Lastupdateby))
						return false;
						
					if (!this.m_Seqnoindex.Equals(castObj.Seqnoindex))
						return false;
						
					return true;
				}
				return false;
			}
			
			/// <summary>
			/// 重载GetHashCode
			/// </summary>
			public override int GetHashCode()
			{
					int hash = 0;					
					
					hash = hash <<  8;
					if ((object)m_Seqno != null)
					{
						hash = hash ^ m_Seqno.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Title != null)
					{
						hash = hash ^ m_Title.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Parentid != null)
					{
						hash = hash ^ m_Parentid.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Level != null)
					{
						hash = hash ^ m_Level.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Showdescr != null)
					{
						hash = hash ^ m_Showdescr.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Code != null)
					{
						hash = hash ^ m_Code.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Keyword != null)
					{
						hash = hash ^ m_Keyword.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Content != null)
					{
						hash = hash ^ m_Content.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Filename != null)
					{
						hash = hash ^ m_Filename.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Licd != null)
					{
						hash = hash ^ m_Licd.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Createdate != null)
					{
						hash = hash ^ m_Createdate.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Createby != null)
					{
						hash = hash ^ m_Createby.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Lastupdatedate != null)
					{
						hash = hash ^ m_Lastupdatedate.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Lastupdateby != null)
					{
						hash = hash ^ m_Lastupdateby.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Seqnoindex != null)
					{
						hash = hash ^ m_Seqnoindex.GetHashCode();
					}
						
					return hash; 
			}
			#endregion
			
			public ProductsType()
			{
				MarkNew();
			}						
			
			public ProductsType GetOldValue()
			{
				return OldValue as ProductsType;
			}
		
		#region Seqno属性
			private int m_Seqno = 0;
			/// <summary>
			/// 属性名称： Seqno
			/// 内容摘要： DB列名：Seqno[]
			///            DB类型：int
			/// </summary>
			public int Seqno
			{
				get
					{
						return m_Seqno;
					}
				set
					{
						if (m_Seqno as object == null || !m_Seqno.Equals(value))
						{
							m_Seqno = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Title属性
			private string m_Title = String.Empty;
			/// <summary>
			/// 属性名称： Title
			/// 内容摘要： DB列名：Title[英文名称]
			///            DB类型：string
			/// </summary>
			public string Title
			{
				get
					{
						return m_Title;
					}
				set
					{
						if (m_Title as object == null || !m_Title.Equals(value))
						{
							m_Title = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Parentid属性
			private int m_Parentid = 0;
			/// <summary>
			/// 属性名称： Parentid
			/// 内容摘要： DB列名：Parentid[父节点ID]
			///            DB类型：int
			/// </summary>
			public int Parentid
			{
				get
					{
						return m_Parentid;
					}
				set
					{
						if (m_Parentid as object == null || !m_Parentid.Equals(value))
						{
							m_Parentid = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Level属性
			private int m_Level = 0;
			/// <summary>
			/// 属性名称： Level
			/// 内容摘要： DB列名：Level[级数]
			///            DB类型：int
			/// </summary>
			public int Level
			{
				get
					{
						return m_Level;
					}
				set
					{
						if (m_Level as object == null || !m_Level.Equals(value))
						{
							m_Level = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Showdescr属性
			private string m_Showdescr = String.Empty;
			/// <summary>
			/// 属性名称： Showdescr
			/// 内容摘要： DB列名：ShowDescr[]
			///            DB类型：string
			/// </summary>
			public string Showdescr
			{
				get
					{
						return m_Showdescr;
					}
				set
					{
						if (m_Showdescr as object == null || !m_Showdescr.Equals(value))
						{
							m_Showdescr = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Code属性
			private string m_Code = String.Empty;
			/// <summary>
			/// 属性名称： Code
			/// 内容摘要： DB列名：code[]
			///            DB类型：string
			/// </summary>
			public string Code
			{
				get
					{
						return m_Code;
					}
				set
					{
						if (m_Code as object == null || !m_Code.Equals(value))
						{
							m_Code = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Keyword属性
			private string m_Keyword = String.Empty;
			/// <summary>
			/// 属性名称： Keyword
			/// 内容摘要： DB列名：KeyWord[]
			///            DB类型：string
			/// </summary>
			public string Keyword
			{
				get
					{
						return m_Keyword;
					}
				set
					{
						if (m_Keyword as object == null || !m_Keyword.Equals(value))
						{
							m_Keyword = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Content属性
			private string m_Content = String.Empty;
			/// <summary>
			/// 属性名称： Content
			/// 内容摘要： DB列名：Content[]
			///            DB类型：string
			/// </summary>
			public string Content
			{
				get
					{
						return m_Content;
					}
				set
					{
						if (m_Content as object == null || !m_Content.Equals(value))
						{
							m_Content = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Filename属性
			private string m_Filename = String.Empty;
			/// <summary>
			/// 属性名称： Filename
			/// 内容摘要： DB列名：FileName[]
			///            DB类型：string
			/// </summary>
			public string Filename
			{
				get
					{
						return m_Filename;
					}
				set
					{
						if (m_Filename as object == null || !m_Filename.Equals(value))
						{
							m_Filename = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Licd属性
			private int m_Licd = 0;
			/// <summary>
			/// 属性名称： Licd
			/// 内容摘要： DB列名：Licd[]
			///            DB类型：int
			/// </summary>
			public int Licd
			{
				get
					{
						return m_Licd;
					}
				set
					{
						if (m_Licd as object == null || !m_Licd.Equals(value))
						{
							m_Licd = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Createdate属性
			private DateTime m_Createdate = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： Createdate
			/// 内容摘要： DB列名：CreateDate[]
			///            DB类型：DateTime
			/// </summary>
			public DateTime Createdate
			{
				get
					{
						return DateTime.Parse(m_Createdate.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_Createdate as object == null || !m_Createdate.Equals(value))
						{
							m_Createdate = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Createby属性
			private string m_Createby = String.Empty;
			/// <summary>
			/// 属性名称： Createby
			/// 内容摘要： DB列名：CreateBy[]
			///            DB类型：string
			/// </summary>
			public string Createby
			{
				get
					{
						return m_Createby;
					}
				set
					{
						if (m_Createby as object == null || !m_Createby.Equals(value))
						{
							m_Createby = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Lastupdatedate属性
			private DateTime m_Lastupdatedate = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： Lastupdatedate
			/// 内容摘要： DB列名：LastupdateDate[]
			///            DB类型：DateTime
			/// </summary>
			public DateTime Lastupdatedate
			{
				get
					{
						return DateTime.Parse(m_Lastupdatedate.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_Lastupdatedate as object == null || !m_Lastupdatedate.Equals(value))
						{
							m_Lastupdatedate = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Lastupdateby属性
			private string m_Lastupdateby = String.Empty;
			/// <summary>
			/// 属性名称： Lastupdateby
			/// 内容摘要： DB列名：LastupdateBy[]
			///            DB类型：string
			/// </summary>
			public string Lastupdateby
			{
				get
					{
						return m_Lastupdateby;
					}
				set
					{
						if (m_Lastupdateby as object == null || !m_Lastupdateby.Equals(value))
						{
							m_Lastupdateby = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Seqnoindex属性
			private int m_Seqnoindex = 0;
			/// <summary>
			/// 属性名称： Seqnoindex
			/// 内容摘要： DB列名：seqnoIndex[]
			///            DB类型：int
			/// </summary>
			public int Seqnoindex
			{
				get
					{
						return m_Seqnoindex;
					}
				set
					{
						if (m_Seqnoindex as object == null || !m_Seqnoindex.Equals(value))
						{
							m_Seqnoindex = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region static CreateDataTable/FillDataRow/DataRow2Obj/Dt2Objs/FillDataTable
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="tableName">表名</param>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(string tableName,ColumnNameEnum cne)
			{
				DataTable dtResult = new DataTable(tableName);
			
				if (cne == ColumnNameEnum.DBName)
				{
					dtResult.Columns.Add(new DataColumn("Seqno",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Title",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Parentid",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Level",typeof(int)));
					dtResult.Columns.Add(new DataColumn("ShowDescr",typeof(string)));
					dtResult.Columns.Add(new DataColumn("code",typeof(string)));
					dtResult.Columns.Add(new DataColumn("KeyWord",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Content",typeof(string)));
					dtResult.Columns.Add(new DataColumn("FileName",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Licd",typeof(int)));
					dtResult.Columns.Add(new DataColumn("CreateDate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("CreateBy",typeof(string)));
					dtResult.Columns.Add(new DataColumn("LastupdateDate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("LastupdateBy",typeof(string)));
					dtResult.Columns.Add(new DataColumn("seqnoIndex",typeof(int)));
				}
				else if (cne == ColumnNameEnum.PropertyName)
				{
					dtResult.Columns.Add(new DataColumn("Seqno",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Title",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Parentid",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Level",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Showdescr",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Code",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Keyword",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Content",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Filename",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Licd",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Createdate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("Createby",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Lastupdatedate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("Lastupdateby",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Seqnoindex",typeof(int)));
				}
				return dtResult;
			}
			
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(ColumnNameEnum cne)
			{
				return CreateDataTable(null,cne);
			}

			/// <summary>
			/// 得到实体对应的DataTable(默认列名映射为属性名)
			/// </summary>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable()
			{
				return CreateDataTable(ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			public void FillDataRow(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				if (ColumnNameEnum.DBName == cne)
				{
					dr["Seqno"] = this.Seqno;
					dr["Title"] = this.Title;
					dr["Parentid"] = this.Parentid;
					dr["Level"] = this.Level;
					dr["ShowDescr"] = this.Showdescr;
					dr["code"] = this.Code;
					dr["KeyWord"] = this.Keyword;
					dr["Content"] = this.Content;
					dr["FileName"] = this.Filename;
					dr["Licd"] = this.Licd;
					dr["CreateDate"] = this.Createdate;
					dr["CreateBy"] = this.Createby;
					dr["LastupdateDate"] = this.Lastupdatedate;
					dr["LastupdateBy"] = this.Lastupdateby;
					dr["seqnoIndex"] = this.Seqnoindex;
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					dr["Seqno"] = this.Seqno;
					dr["Title"] = this.Title;
					dr["Parentid"] = this.Parentid;
					dr["Level"] = this.Level;
					dr["Showdescr"] = this.Showdescr;
					dr["Code"] = this.Code;
					dr["Keyword"] = this.Keyword;
					dr["Content"] = this.Content;
					dr["Filename"] = this.Filename;
					dr["Licd"] = this.Licd;
					dr["Createdate"] = this.Createdate;
					dr["Createby"] = this.Createby;
					dr["Lastupdatedate"] = this.Lastupdatedate;
					dr["Lastupdateby"] = this.Lastupdateby;
					dr["Seqnoindex"] = this.Seqnoindex;					
				}
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow(默认列名映射为属性名)
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			public void FillDataRow(DataRow dr)
			{
				this.FillDataRow(dr,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 将DataRow转换成ProductsType对象
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			/// <returns>ProductsType对象</returns>
			public static ProductsType Dr2Obj(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				ProductsType obj = new ProductsType();
				if (ColumnNameEnum.DBName == cne)
				{
					obj.Seqno = (dr["Seqno"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Seqno"],typeof(int));
					obj.Title = (dr["Title"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Title"],typeof(string));
					obj.Parentid = (dr["Parentid"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Parentid"],typeof(int));
					obj.Level = (dr["Level"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Level"],typeof(int));
					obj.Showdescr = (dr["ShowDescr"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["ShowDescr"],typeof(string));
					obj.Code = (dr["code"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["code"],typeof(string));
					obj.Keyword = (dr["KeyWord"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["KeyWord"],typeof(string));
					obj.Content = (dr["Content"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Content"],typeof(string));
					obj.Filename = (dr["FileName"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["FileName"],typeof(string));
					obj.Licd = (dr["Licd"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Licd"],typeof(int));
					obj.Createdate = (dr["CreateDate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["CreateDate"],typeof(DateTime));
					obj.Createby = (dr["CreateBy"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["CreateBy"],typeof(string));
					obj.Lastupdatedate = (dr["LastupdateDate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["LastupdateDate"],typeof(DateTime));
					obj.Lastupdateby = (dr["LastupdateBy"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["LastupdateBy"],typeof(string));
					obj.Seqnoindex = (dr["seqnoIndex"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["seqnoIndex"],typeof(int));
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					obj.Seqno = (dr["Seqno"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Seqno"],typeof(int));
					obj.Title = (dr["Title"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Title"],typeof(string));
					obj.Parentid = (dr["Parentid"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Parentid"],typeof(int));
					obj.Level = (dr["Level"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Level"],typeof(int));
					obj.Showdescr = (dr["Showdescr"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Showdescr"],typeof(string));
					obj.Code = (dr["Code"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Code"],typeof(string));
					obj.Keyword = (dr["Keyword"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Keyword"],typeof(string));
					obj.Content = (dr["Content"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Content"],typeof(string));
					obj.Filename = (dr["Filename"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Filename"],typeof(string));
					obj.Licd = (dr["Licd"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Licd"],typeof(int));
					obj.Createdate = (dr["Createdate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["Createdate"],typeof(DateTime));
					obj.Createby = (dr["Createby"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Createby"],typeof(string));
					obj.Lastupdatedate = (dr["Lastupdatedate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["Lastupdatedate"],typeof(DateTime));
					obj.Lastupdateby = (dr["Lastupdateby"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Lastupdateby"],typeof(string));
					obj.Seqnoindex = (dr["Seqnoindex"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Seqnoindex"],typeof(int));		
				}
				
				return obj;
			}
			
			/// <summary>
			/// 将DataRow转换成ProductsType对象(默认列名映射为属性名)
			/// </summary>
			/// <returns>ProductsType对象</returns>
			public static ProductsType Dr2Obj(DataRow dr)
			{
				return Dr2Obj(dr,ColumnNameEnum.DBName);
			}
			
			/// <summary>
			/// 将DataTabe转换成的ProductsType对象集合
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			/// <returns>ProductsType对象的集合</returns>
			public static IList Dt2Objs(DataTable dt,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				
				ArrayList alResult = new ArrayList();
				
				foreach(DataRow dr in dt.Rows)
				{
					alResult.Add(Dr2Obj(dr,cne));
				}
				
				return alResult;
			}

			/// <summary>
			/// 将DataTabe转换成的ProductsType对象集合(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <returns>ProductsType对象的集合</returns>
			public static IList Dt2Objs(DataTable dt)
			{
				return Dt2Objs(dt,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用objs的ProductsType对象集合填充DataTable
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">ProductsType对象集合</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			public static void FillDataTable(DataTable dt,IList objs,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				if (objs == null)
				{
					throw new ArgumentNullException("objs");
				}
				
				foreach(ProductsType obj in objs)
				{
					DataRow dr = dt.NewRow();
					obj.FillDataRow(dr,cne);
					dt.Rows.Add(dr);
				}
			}

			/// <summary>
			/// 用objs的ProductsType对象集合填充DataTable(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">ProductsType对象集合</param>
			public static void FillDataTable(DataTable dt,IList objs)
			{
				FillDataTable(dt,objs,ColumnNameEnum.PropertyName);
			}
		#endregion
		
		/// <summary>
		/// 取消编辑,恢复到上次有效调用BeginEdit前的状态,并清空保留值
		/// </summary>
		public override void CancelEdit()
		{
			ProductsType old = this.OldValue as ProductsType;
			if (old != null)
			{
					this.Seqno = old.Seqno;
					this.Title = old.Title;
					this.Parentid = old.Parentid;
					this.Level = old.Level;
					this.Showdescr = old.Showdescr;
					this.Code = old.Code;
					this.Keyword = old.Keyword;
					this.Content = old.Content;
					this.Filename = old.Filename;
					this.Licd = old.Licd;
					this.Createdate = old.Createdate;
					this.Createby = old.Createby;
					this.Lastupdatedate = old.Lastupdatedate;
					this.Lastupdateby = old.Lastupdateby;
					this.Seqnoindex = old.Seqnoindex;				
				this.OldValue = null;
			}
		}
		
		
		
		
		#region ProductsType实体的内部Key类
			/// <summary>
			/// ProductsType实体的Key类
			/// </summary>
			public sealed class Key
			{
		
				private int m_Seqno;
				public int Seqno
				{
 					get 
					{ 
						 return m_Seqno; 
					}
					set 
					{ 
						m_Seqno = value;
					}
				}
		
				public Key(int pSeqno)
				{
					m_Seqno=pSeqno;

				}
			}
		#endregion
			/// <summary>
			/// 得到实体ProductsType的PK
			/// </summary>
			public Key GetKey()
			{
				return new Key(Seqno);				
			}
			
				
		#endregion
	}
}
